﻿using QuickGraph;
using System.Diagnostics;
using System.ComponentModel;

namespace GIMS.GUI.GraphItems
{
    [DebuggerDisplay("{Source.Name} -> {Target.Name}")]
    public class CustomEdge : Edge<CustomVertex>, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private int sequence;
        private bool hasSequence;

        public CustomEdge(CustomVertex source, CustomVertex target)
            : base(source, target)
        {
            Sequence = 1;
            hasSequence = false;
        }

        public bool HasSequence
        {
            get { return hasSequence; }
            set
            {
                hasSequence = value;
                NotifyPropertyChanged("HasSequence");
            }
        }

        public int Sequence
        {
            get { return sequence; }
            set
            {
                sequence = value;
                NotifyPropertyChanged("Sequence");
            }
        }

        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
}
